<div class="content-wrapper">

    <section class="content-header">
        <?php echo $this->partial('layout/breadcrumb'); ?>
        <h1 class="pull-right" id="dbshop-menu-top">
            <a href="<?php echo $this->url('goods-attribute');?>" class="btn btn-default btn-sm"><i class="fa fa-arrow-left"></i> <?php echo $this->translate('返回属性列表'); ?></a>
            <a href="<?php echo $this->url('goods-attribute', ['action'=> 'addAttributeValue', 'id' => $this->attributeInfo->getAttributeId()]);?>" class="btn btn-primary btn-sm"><i class="fa fa-plus"></i> <?php echo $this->translate('添加属性值'); ?></a>
            <?php echo $this->HelpUrl('goodsAttributeValue'); ?>
        </h1>
    </section>

    <section class="content">
        <?php echo $this->partial('layout/messages'); ?>

        <div class="row">
            <div class="col-xs-12">
                <form method="post" action="<?php echo $this->url('goods-attribute', ['action' => 'updateAttributeValueAll']);?>" name="edit-all-form" id="edit-all-form">
                    <div class="box shop-box">
                        <div class="box-body table-responsive no-padding">
                            <table class="table shop-table table-hover">
                                <thead>
                                <tr class="shop-bg-thead">
                                    <th width="2%"><input type="checkbox" class="minimal select-all-checkbox"></th>
                                    <th width="40%"><?php echo $this->translate('属性值名称') . ' -（' . $this->translate('属性：') . $this->escapeHtml($this->attributeInfo->getAttributeName()) . '）'; ?></th>
                                    <th width="10%"><?php echo $this->translate('排序'); ?></th>
                                    <th width="10%"><?php echo $this->translate('操作'); ?></th>
                                </tr>
                                </thead>
                                <tbody>
                                <?php if($this->attributeValueList) foreach ($this->attributeValueList as $value) { ?>
                                    <tr>
                                        <td><input name="select_id[]" value="<?php echo $value->getValueId(); ?>" type="checkbox" ></td>
                                        <td><?php echo $this->escapeHtml($value->getValueName()); ?></td>
                                        <td><input type="number" name="valueSort[<?php echo $value->getValueId(); ?>]" value="<?php echo $this->escapeHtml($value->getValueSort()); ?>" class="form-control input-sm"></td>
                                        <td>
                                            <a href="<?php echo $this->url('goods-attribute',
                                                ['action'=>'editAttributeValue', 'id'=>$value->getAttributeId(), 'vid' => $value->getValueId()]); ?>"
                                               class="btn btn-xs btn-success"><i class="fa fa-pencil"></i> <?php echo $this->translate('编辑'); ?></a>

                                            <a href="javascript:;" onclick="deleteConfirm('<?php echo $this->translate('您确实要删除该属性值吗?'); ?>', '<?php echo $this->url('goods-attribute', ['action'=>'deleteAttributeValue', 'id'=>$value->getValueId()], ['query' => ['qToken' => $this->adminHelper()->getCsrfValue()]]); ?>');" class="btn btn-xs btn-danger"><i class="fa fa-trash"></i> <?php echo $this->translate('删除'); ?></a>
                                        </td>
                                    </tr>
                                <?php } ?>
                                </tbody>
                            </table>
                        </div>
                        <div class="box-footer clearfix">
                            <input type="checkbox" class="minimal select-all-checkbox"> <?php echo $this->translate('全选'); ?>
                            <select name="editAllState">
                                <option value=""><?php echo $this->translate('选择状态'); ?></option>
                                <option value="sort"><?php echo $this->translate('排序'); ?></option>
                                <option value="del"><?php echo $this->translate('删除'); ?></option>
                            </select>
                            <button type="submit" class="btn btn-primary btn-sm"><i class="fa fa-check"></i> <?php echo $this->translate('更新'); ?></button>
                        </div>
                    </div>
                </form>
            </div>
        </div>

    </section>
</div>